﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="CreateFlavorProject" xmlns="http://schemas.microsoft.com/pag/gax-core"
                               xmlns:xi="http://www.w3.org/2001/XInclude" Bound="false">
  <DocumentationLinks>
    <Link Kind="Documentation" Caption="Project Subtypes" Url="ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.vssdk.v90/dv_vsintegration/html/d235b47b-cf11-4d47-a63f-e33d9d16105d.htm" />
  </DocumentationLinks>
  <xi:include href="../../Common/CommonTypeAliases.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>Create Flavor Project</Caption>
  <Description>Create Flavor Project</Description>
  <HostData>
    <Icon File="Resources\FlavorProject.ico" />
    <CommandBar Menu="VSSDKAssistFlavorProject"/>
  </HostData>
  <Arguments>
    <xi:include href="../../Common/CommonArguments.xml"
					  xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Arguments/gax:Argument)" />
    <Argument Name="VSPackageProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.VisualStudio.CurrentlySelectedProjectValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="VSPackageProjectNamespace" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProject.Properties.Item('DefaultNamespace').Value.ToString())"
                     Stage="OnBeginRecipe">
      </ValueProvider>
    </Argument>
    <Argument Name="VSPackageCodeClass" Type="EnvDTE.CodeClass, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.VSPackageCodeClassValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="DestinationFolder" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="FlavorProjects"
                     Stage="OnBeginRecipe" />
    </Argument>
    <Argument Name="ProjectNamespace" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProjectNamespace).$(DestinationFolder)"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="VSPackageProjectNamespace"/>
        <MonitorArgument Name="DestinationFolder"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ProjectTT">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.TTPathValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"
                     SubPath="FlavorProject\Create"
                     TTFile="Project.tt">
      </ValueProvider>
    </Argument>
    <Argument Name="ProjectFactoryTT">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.TTPathValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"
                     SubPath="FlavorProject\Create"
                     TTFile="ProjectFactory.tt">
      </ValueProvider>
    </Argument>
    <Argument Name="ProvideProjectFactoryAttributeTT">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.TTPathValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"
                     SubPath="FlavorProject\Create"
                     TTFile="ProvideProjectFactoryAttribute.tt">
      </ValueProvider>
    </Argument>
    <Argument Name="RegisterProjectFactoryCallTT">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.TTPathValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"
                     SubPath="FlavorProject\Create"
                     TTFile="RegisterProjectFactoryCall.tt">
      </ValueProvider>
    </Argument>
    <Argument Name="ProjectGuid" Type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.GuidValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="ProjectFactoryGuid" Type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.GuidValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="TypeOfFlavor" Type="VSSDKAssist.Enums.FlavorProjectType, VSSDKAssist"/>
    <Argument Name="LanguageExtension" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.VisualStudio.CurrentlySelectedProjectLanguageValueProvider, VSSDKAssist.Assets"
               Stage="OnBeginRecipe">
      </ValueProvider>
    </Argument>
    <Argument Name="ProjectName" Required="true">
      <Converter Type="VSSDKAssist.Assets.Converters.CSharpIdentifierConverter, VSSDKAssist.Assets"/>
    </Argument>
    <Argument Name="ProjectFriendlyName" Required="true"/>
    <Argument Name="ProjectDescription" Required="true"/>
    <Argument Name="ProjectFileName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(ProjectName).$(LanguageExtension)"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ProjectName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ProjectFactoryName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(ProjectName)Factory"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ProjectName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ProjectFactoryFileName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(ProjectFactoryName).$(LanguageExtension)"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ProjectFactoryName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="TemplateExtension" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.FlavorProject.CreateFlavorProject.TemplateExtensionValueProvider, VSSDKAssist"
                     Stage="OnBeforeActions"
                     TypeOfFlavorArgument="TypeOfFlavor">
        <MonitorArgument Name="TypeOfFlavor"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ProjFileName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(ProjectName).$(TemplateExtension)proj"
                     Stage="OnBeforeActions">
        <MonitorArgument Name="ProjectName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="VsTemplateFileName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(ProjectName).vstemplate"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ProjectName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ClassFileName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="Class1.$(TemplateExtension)"
                     Stage="OnBeforeActions">
      </ValueProvider>
    </Argument>
    <Argument Name="SourceIconFileName" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.EmptyIconValueProvider, VSSDKAssist"
               ImageSize="Size16x16"
               Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="IconFileName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(ProjectName).ico"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ProjectName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="IconDestinationFolder" Type="EnvDTE.ProjectItem, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.ResourcesFolderValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="VsPackageClassName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageCodeClass.Name)"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="VSPackageCodeClass"/>
      </ValueProvider>
    </Argument>
    <Argument Name="AssemblyNamespace" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProject.Properties.Item('DefaultNamespace').Value.ToString())"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="VSPackageProject"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ProjectNameFolderStructure" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="Templates\Projects\$(ProjectName)"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ProjectName"/>  
      </ValueProvider>
    </Argument>
  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Type="VSSDKAssist.Recipes.FlavorProject.CreateFlavorProject.CreateFlavorProjectCP1, VSSDKAssist"
              Height="200" Width="510">
          <Title>Specify flavor project general properties</Title>
          <LinkTitle>Flavor project general properties</LinkTitle>
        </Page>
        <Page Type="VSSDKAssist.Recipes.FlavorProject.CreateFlavorProject.CreateFlavorProjectCP2, VSSDKAssist"
            Height="200" Width="510">
          <Title>Specify flavor project UI properties 1</Title>
          <LinkTitle>Flavor project UI properties 1</LinkTitle>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="VSSDKAssist.Recipes.Common.Coordinators.ExecutionProgressCoordinator, VSSDKAssist">
    <!--Create Folders-->
    <Action Name="GenerateProjectNameFolderStructure"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddProjectFolderAction, VSSDKAssist.Assets"
          StatusMessage="Creating destination folders"
          WriteMessageToOutputWindow="true">
      <Input Name="FolderName" RecipeArgument="ProjectNameFolderStructure"/>
      <Output Name="FolderAdded" />
    </Action>
    <Action Name="GenerateDestinationFolder"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddProjectFolderAction, VSSDKAssist.Assets">
      <Input Name="FolderName" RecipeArgument="DestinationFolder"/>
      <Output Name="FolderAdded" />
    </Action>
    <!--Create Classes-->
    <Action Name="GenerateProjectContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          StatusMessage="Creating flavor project classes"
          WriteMessageToOutputWindow="true">
      <Input Name="Template" RecipeArgument="ProjectTT"/>
      <Input Name="ProjectNamespace" RecipeArgument="ProjectNamespace"/>
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Input Name="ProjectGuid" RecipeArgument="ProjectGuid"/>
      <Input Name="VsPackageClassName" RecipeArgument="VsPackageClassName"/>
      <Input Name="AssemblyNamespace" RecipeArgument="AssemblyNamespace"/>
      <Input Name="IconFileName" RecipeArgument="IconFileName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddProjectContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true">
      <Input Name="Content" ActionOutput="GenerateProjectContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="ProjectFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateDestinationFolder.FolderAdded" />
    </Action>
    <Action Name="GenerateProjectFactoryContent"
      Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="ProjectFactoryTT"/>
      <Input Name="ProjectNamespace" RecipeArgument="ProjectNamespace"/>
      <Input Name="ProjectFactoryName" RecipeArgument="ProjectFactoryName"/>
      <Input Name="ProjectFactoryGuid" RecipeArgument="ProjectFactoryGuid"/>
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Input Name="VsPackageClassName" RecipeArgument="VsPackageClassName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddProjectFactoryContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true">
      <Input Name="Content" ActionOutput="GenerateProjectFactoryContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="ProjectFactoryFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateDestinationFolder.FolderAdded" />
    </Action>
    <!--Create template-->
    <Action Name="GenerateClassContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          StatusMessage="Creating flavor project template"
          WriteMessageToOutputWindow="true"
          Template="TT\common\FlavorProject\Template\Class.tt">
      <Input Name="TypeOfFlavor" RecipeArgument="TypeOfFlavor"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddClassContent"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
            Open="false">
      <Input Name="Content" ActionOutput="GenerateClassContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="ClassFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateProjectNameFolderStructure.FolderAdded" />
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction1"
       Type="VSSDKAssist.Recipes.Common.Actions.SetZipProjectBuildAction, VSSDKAssist">
      <Input Name="ProjectItem" ActionOutput="AddClassContent.ProjectItem"/>
    </Action>
    <Action Name="GenerateProjContent"
            Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
            Template="TT\common\FlavorProject\Template\Proj.tt">
      <Input Name="ProjectFactoryGuid" RecipeArgument="ProjectFactoryGuid"/>
      <Input Name="TypeOfFlavor" RecipeArgument="TypeOfFlavor"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddProjContent"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
            Open="false">
      <Input Name="Content" ActionOutput="GenerateProjContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="ProjFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateProjectNameFolderStructure.FolderAdded" />
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction2"
        Type="VSSDKAssist.Recipes.Common.Actions.SetZipProjectBuildAction, VSSDKAssist">
      <Input Name="ProjectItem" ActionOutput="AddProjContent.ProjectItem"/>
    </Action>
    <Action Name="GenerateVsTemplateContent"
            Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
            Template="TT\common\FlavorProject\Template\VsTemplate.tt">
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Input Name="ProjectFriendlyName" RecipeArgument="ProjectFriendlyName"/>
      <Input Name="ProjectDescription" RecipeArgument="ProjectDescription"/>
      <Input Name="IconFileName" RecipeArgument="IconFileName"/>
      <Input Name="ProjFileName" RecipeArgument="ProjFileName"/>
      <Input Name="TypeOfFlavor" RecipeArgument="TypeOfFlavor"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddVsTemplateContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="false">
      <Input Name="Content" ActionOutput="GenerateVsTemplateContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="VsTemplateFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateProjectNameFolderStructure.FolderAdded" />
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction3"
      Type="VSSDKAssist.Recipes.Common.Actions.SetZipProjectBuildAction, VSSDKAssist">
      <Input Name="ProjectItem" ActionOutput="AddVsTemplateContent.ProjectItem"/>
    </Action>
    <Action Name="AddIconFile1" Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromFileToProjectItemAction, VSSDKAssist.Assets"
        Open="false">
      <Input Name="SourceFileName" RecipeArgument="SourceIconFileName"/>
      <Input Name="TargetFileName" RecipeArgument="IconFileName"/>
      <Input Name="InputProjectItem" RecipeArgument="IconDestinationFolder"/>
      <Output Name="ProjectItem" />
    </Action>
    <Action Name="SetBuildAction4"
      Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
      BuildAction="prjBuildActionEmbeddedResource">
      <Input Name="ProjectItem" ActionOutput="AddIconFile1.ProjectItem"/>
    </Action>
    <Action Name="AddIconFile2" Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromFileToProjectItemAction, VSSDKAssist.Assets"
        Open="false">
      <Input Name="SourceFileName" RecipeArgument="SourceIconFileName"/>
      <Input Name="TargetFileName" RecipeArgument="IconFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateProjectNameFolderStructure.FolderAdded"/>
      <Output Name="ProjectItem" />
    </Action>
    <Action Name="SetBuildAction5"
      Type="VSSDKAssist.Recipes.Common.Actions.SetZipProjectBuildAction, VSSDKAssist">
      <Input Name="ProjectItem" ActionOutput="AddIconFile2.ProjectItem"/>
    </Action>
    <Action Name="GenerateProvideProjectFactoryAttributeContent"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
        StatusMessage="Adding flavor project registration information"
        WriteMessageToOutputWindow="true">
      <Input Name="Template" RecipeArgument="ProvideProjectFactoryAttributeTT"/>
      <Input Name="ProjectNamespace" RecipeArgument="ProjectNamespace"/>
      <Input Name="ProjectFactoryName" RecipeArgument="ProjectFactoryName"/>
      <Input Name="ProjectFriendlyName" RecipeArgument="ProjectFriendlyName"/>
      <Input Name="TypeOfFlavor" RecipeArgument="TypeOfFlavor"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddProvideProjectFactoryAttribute"
            Type="VSSDKAssist.Recipes.Common.Actions.InsertAttributeToCodeClassAction, VSSDKAssist">
      <Input Name="CodeClass" RecipeArgument="VSPackageCodeClass"/>
      <Input Name="AttributeValue" ActionOutput="GenerateProvideProjectFactoryAttributeContent.Content"/>
    </Action>
    <Action Name="GenerateRegisterProjectFactoryCallContent"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="RegisterProjectFactoryCallTT"/>
      <Input Name="ProjectNamespace" RecipeArgument="ProjectNamespace"/>
      <Input Name="ProjectFactoryName" RecipeArgument="ProjectFactoryName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddRegisterProjectFactoryCall"
            Type="VSSDKAssist.Recipes.Common.Actions.AddRegisterProjectFactoryCallAction, VSSDKAssist">
      <Input Name="CodeClass" RecipeArgument="VSPackageCodeClass"/>
      <Input Name="CallContent" ActionOutput="GenerateRegisterProjectFactoryCallContent.Content"/>
    </Action>    
  </Actions>
</Recipe>